/**
 * for weather
 */
//http://www.weather.com.cn/data/cityinfo/101010100.html
//http://www.weather.com.cn/data/sk/101010100.html
//http://m.weather.com.cn/data/101010100.html

/**
 * some string define here
 * even in html its value change, here just change this define
 */
var JS_WEATHER_RESULT = ".js-weather-result";

var WEATHER_CITY = "http://www.weather.com.cn/data/cityinfo/101010100.html";
var WEATHER_SK = "http://www.weather.com.cn/data/sk/101010100.html";
var WEATHER_DATA = "http://m.weather.com.cn/data/101010100.html";
var NEW_WEATHER_CITY = "http://weather.china.xappengine.com/api";
var WEATHER_PROVINCE = "http://weather.com.cn/data/city3jdata/china.html";
var WEATHER_URL = ﻿"http://9snow.org/weather/api";

/**
 * weather control interface
 */
var jk_weather = function() {
    /* -- query weather with city */
    /* -- choose where to query depends us */
	this.queryWeather = function(city, callback) {
        jk_send_request_get(WEATHER_URL, "city="+city, callback);
	}
	this.queryProvince = function(callback) {
		jk_send_request_get(WEATHER_PROVINCE, "", callback);
	}
};

function responseWeather(data, textStatus) {
    var responseString = textStatus + data;
    $(JS_WEATHER_RESULT).text(textStatus);
}

$(function(){
	/** -- start here */
    var weth = new jk_weather();
    // weth.queryProvince(responseWeather);
    weth.queryWeather("合肥", responseWeather);
});
